package lex.explorer.file;

import org.lex.explorer.FileInfo;
import org.lex.utils.CategoryComparator;

public class FileNameComparator implements CategoryComparator<FileInfo>
{
	@Override
	public int compare( FileInfo f1, FileInfo f2 )
	{
		return f1.getName().compareTo( f2.getName() );
	}

	@Override
	public int getCategory( FileInfo file )
	{
		if( file.isDirectory() )
			return 0;
		return 1;
	}
}
